# -*- coding: utf-8 -*-
# @Time        :2024/9/29 下午4:32
# @Author      :文刀水寿
# @File        : 07_基础柱状图开发.py
"""
 @Description :
"""
from pyecharts.charts import Bar
from pyecharts.options import LabelOpts

# 使用Bar构建基础柱状图
bar = Bar()

bar.add_xaxis(["中国", "美国", "英国"])
bar.add_yaxis("GDP", [30, 20, 10], label_opts=LabelOpts(position="right"))

# 反转X轴和Y轴
bar.reversal_axis()

# 设置数值标签在右侧
# "label_opts=LabelOpts(position="right")"

# 绘图
bar.render("基础柱状图.html")
